<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:f="http://java.sun.com/jsf/core">
    <!-- INTERFACE -->
    <composite:interface>

        <composite:attribute name="cidade" required="true"/>
        <composite:attribute name="buttonText" required="true" default="Criar"/>
        <composite:attribute name="onclick_button_update" />
        <composite:attribute name="onclick_sair_javascript" />
        <composite:attribute name="buttonAction" required="true"
                             method-signature="java.lang.String action()"/>
    </composite:interface>


    <!-- IMPLEMENTATION -->
    <composite:implementation>
        <h:form id="new_fornecedor_form">

            <h:panelGrid columns="2">
                <h:outputText value="Nome:" styleClass="formShortLabel"/>
                <p:inputText value="#{cc.attrs.cidade.name}" style="width: 200px" />

                <h:outputText value="Estado:" styleClass="formShortLabel"/>
                <p:inputText value="#{cc.attrs.cidade.estado}" style="width: 200px" />

                <h:outputText value="País:" styleClass="formShortLabel"/>
                <p:inputText value="#{cc.attrs.cidade.pais}" style="width: 200px" />

            </h:panelGrid>
        
            <p:separator />
            <p:commandButton value="#{cc.attrs.buttonText}" action="#{cc.attrs.buttonAction}"
                             onclick="#{cc.attrs.onclick_sair_javascript}" update="#{cc.attrs.onclick_button_update}" />
        </h:form>
    </composite:implementation>
</html>

